package com.galen.wxRead.mapper;

import com.galen.wxRead.domain.ReadWx;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 微信账号Mapper接口
 * 
 * @author ruoyi
 * @date 2021-11-12
 */
@Mapper
public interface ReadWxMapper 
{
    /**
     * 查询微信账号
     * 
     * @param id 微信账号ID
     * @return 微信账号
     */
    public ReadWx selectReadWxById(Long id);

    public ReadWx selectReadWxByWxId(String wxId);

    /**
     * 查询微信账号列表
     * 
     * @param readWx 微信账号
     * @return 微信账号集合
     */
    public List<ReadWx> selectReadWxList(ReadWx readWx);

    @Select("select * from read_wx")
    public List<ReadWx> selectAllReadWx();

    public int count(ReadWx readWx);

    /**
     * 新增微信账号
     * 
     * @param readWx 微信账号
     * @return 结果
     */
    public int insertReadWx(ReadWx readWx);

    public int batchInsertWx(List<ReadWx> readWxList);

    /**
     * 修改微信账号
     * 
     * @param readWx 微信账号
     * @return 结果
     */
    public int updateReadWx(ReadWx readWx);

    /**
     * 删除微信账号
     * 
     * @param id 微信账号ID
     * @return 结果
     */
    public int deleteReadWxById(Long id);

    public int deleteReadWxByWxId(String wxId);

    /**
     * 批量删除微信账号
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteReadWxByIds(Long[] ids);

    @Select("select wx_id,server,type,all_num from read_wx order by type,all_num desc")
    public List<ReadWx> selectReadWx();
}
